<!-- INCLUDE ucp_header.html -->

<!-- IF S_EDIT_CATEGORY -->
	<h2>{L_EDIT_CATEGORY}<!-- IF CATEGORY_NAME -->:: {CATEGORY_NAME}<!-- ENDIF --></h2>
	<div class="panel">
		<div class="inner"><span class="corners-top"><span></span></span>

	<p>{L_CATEGORY_EDIT_EXPLAIN}</p>

	<form id="forumedit" method="post" action="{U_EDIT_ACTION}">

	<fieldset class="fields1">
		<!-- IF S_ERROR --><p class="error">{ERROR_MSG}</p><!-- ENDIF -->

		<dl>
			<dt><label for="parent">{L_CATEGORY_PARENT}:</label></dt>
			<dd><select id="parent" name="category_parent_id"><option value="0"<!-- IF not S_CATEGORY_PARENT_ID --> selected="selected"<!-- ENDIF -->>{L_NO_PARENT}</option>{S_PARENT_OPTIONS}</select></dd>
		</dl>
		<dl>
			<dt><label for="category_name">{L_CATEGORY_NAME}:</label></dt>
			<dd><input class="inputbox" type="text" id="category_name" name="category_name" value="{CATEGORY_NAME}" maxlength="255" /></dd>
		</dl>
		<dl>
			<dt><label for="category_desc">{L_CATEGORY_DESC}:</label></dt>
			<dd><textarea id="category_desc" name="category_desc" rows="5" cols="45">{CATEGORY_DESC}</textarea></dd>
			<dd>
				<!-- IF S_BBCODE_ALLOWED -->
					<label for="disable_bbcode"><input type="checkbox" name="disable_bbcode" id="disable_bbcode"{S_BBCODE_CHECKED} /> {L_DISABLE_BBCODE}</label>
				<!-- ENDIF -->
				<!-- IF S_SMILIES_ALLOWED -->
					<label for="disable_smilies"><input type="checkbox" name="disable_smilies" id="disable_smilies"{S_SMILIES_CHECKED} /> {L_DISABLE_SMILIES}</label>
				<!-- ENDIF -->
				<!-- IF S_LINKS_ALLOWED -->
					<label for="disable_magic_url"><input type="checkbox" name="disable_magic_url" id="disable_magic_url"{S_MAGIC_URL_CHECKED} /> {L_DISABLE_MAGIC_URL}</label>
				<!-- ENDIF -->
			</dd>
		</dl>
	</fieldset>

	<fieldset class="submit-buttons">
		<input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp;
		<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
		{S_FORM_TOKEN}
	</fieldset>
	</form>

<!-- ELSEIF S_DELETE_CATEGORY -->

	<h2>{L_CATEGORY_DELETE}</h2>
	<div class="panel">
		<div class="inner"><span class="corners-top"><span></span></span>

	<p>{L_CATEGORY_DELETE_EXPLAIN}</p>

	<!-- IF S_ERROR -->
		<div class="errorbox">
			<h3>{L_WARNING}</h3>
			<p>{ERROR_MSG}</p>
		</div>
	<!-- ENDIF -->

	<form id="acp_forum" method="post" action="{U_ACTION}">

	<fieldset>
	<dl class="details">
		<dt><label>{L_CATEGORY_NAME}:</label></dt>
		<dd><strong>{CATEGORY_NAME}</strong></dd>
	</dl>
	<!-- IF S_CATEGORY_POST -->
		<dl class="details">
			<dt><label for="delete_action">{L_ACTION}:</label></dt>
			<dd><label><input type="radio" class="radio" id="delete_action" name="action_posts" value="delete" checked="checked" /> {L_DELETE_ALL_POSTS}</label>
			<!-- IF S_MOVE_CATEGORY_OPTIONS -->
			<label><input type="radio" class="radio" name="action_posts" value="move" /> {L_MOVE_POSTS_TO}</label> <select name="posts_to_id">{S_MOVE_CATEGORY_OPTIONS}</select></dd>
			<!-- ENDIF -->
		</dl>
	<!-- ENDIF -->
	<!-- IF S_HAS_SUBCATEGORIES -->
		<dl class="details">
			<dt><label for="sub_delete_action">{L_ACTION}:</label></dt>
			<dd><label><input type="radio" class="radio" id="sub_delete_action" name="action_subcategories" value="delete" checked="checked" /> {L_DELETE_SUBCATEGORIES}</label>
			<!-- IF S_CATEGORIES_LIST -->
				<label><input type="radio" class="radio" name="action_subcategories" value="move" /> {L_MOVE_SUBCATEGORIES_TO}</label> <select name="subcategories_to_id">{S_CATEGORIES_LIST}</select></dd>
			<!-- ENDIF -->
		</dl>
	<!-- ENDIF -->
	</fieldset>

	<fieldset class="submit-buttons">
		<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
		{S_FORM_TOKEN}
	</fieldset>
	</form>

<!-- ELSE -->

	<h2>{L_CATEGORY_MANAGEMENT}</h2>
	<div class="panel">
		<div class="inner"><span class="corners-top"><span></span></span>

		<p>{L_CATEGORY_MANAGEMENT_EXPLAIN}</p>

		<!-- IF ERROR_MSG -->
			<div class="errorbox">
				<h3>{L_WARNING}</h3>
				<p>{ERROR_MSG}</p>
			</div>
		<!-- ENDIF -->

		<!-- IF S_RESYNCED -->
			<script type="text/javascript">
			// <![CDATA[
				var close_waitscreen = 1;
			// ]]>
			</script>

			<div class="successbox">
				<h3>{L_NOTIFY}</h3>
				<p>{L_CATEGORY_RESYNCED}</p>
			</div>
		<!-- ENDIF -->

		<p><strong>{NAVIGATION}<!-- IF S_NO_CATEGORIES --> [<a href="{U_EDIT}">{L_EDIT}</a> | <a href="{U_DELETE}">{L_DELETE}</a><!-- IF not S_LINK --> | <a href="{U_SYNC}">{L_RESYNC}</a><!-- ENDIF --->]<!-- ENDIF --></strong></p>

		<!-- IF .categories -->
		<!-- BEGIN categories -->
		<ul class="topiclist cplist">
		<li class="row bg2">
			<dl>
				<dt>
					{categories.FOLDER_IMAGE}
					<!-- IF categories.CATEGORY_IMAGE --><div style="float: {S_CONTENT_FLOW_BEGIN}; margin-right: 5px;">{categories.CATEGORY_IMAGE}</div><!-- ENDIF -->
					<strong><!-- IF categories.S_CATEGORY_LINK -->{categories.CATEGORY_NAME}<!-- ELSE --><a href="{categories.U_CATEGORY}">{categories.CATEGORY_NAME}</a><!-- ENDIF --></strong>
					<!-- IF categories.CATEGORY_DESCRIPTION --><br /><span>{categories.CATEGORY_DESCRIPTION}</span><!-- ENDIF -->
					<!-- IF categories.S_CATEGORY_POST --><br /><br /><span>{L_TOPICS}: <strong>{categories.CATEGORY_TOPICS}</strong> / {L_POSTS}: <strong>{categories.CATEGORY_POSTS}</strong></span><!-- ENDIF -->
				
				</dt>
				<dd class="mark">
					<!-- IF categories.S_FIRST_ROW && not categories.S_LAST_ROW -->
						{ICON_MOVE_UP_DISABLED}
						<a href="{categories.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
					<!-- ELSEIF not categories.S_FIRST_ROW && not categories.S_LAST_ROW -->
						<a href="{categories.U_MOVE_UP}">{ICON_MOVE_UP}</a>
						<a href="{categories.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
					<!-- ELSEIF categories.S_LAST_ROW && not categories.S_FIRST_ROW -->
						<a href="{categories.U_MOVE_UP}">{ICON_MOVE_UP}</a>
						{ICON_MOVE_DOWN_DISABLED}
					<!-- ELSE -->
						{ICON_MOVE_UP_DISABLED}
						{ICON_MOVE_DOWN_DISABLED}
					<!-- ENDIF -->
					<a href="{categories.U_EDIT}">{ICON_EDIT}</a>
					<!-- IF not categories.S_CATEGORY_LINK -->
						<a href="{categories.U_SYNC}" onclick="popup_progress_bar();">{ICON_SYNC}</a>
					<!-- ELSE -->
						{ICON_SYNC_DISABLED}
					<!-- ENDIF -->
					<a href="{categories.U_DELETE}">{ICON_DELETE}</a>
				</dd>
			</dl>
		</li>
		</ul>
		<!-- END categories -->
		<!-- ENDIF -->

		<form id="fselect" method="post" action="{U_SEL_ACTION}">

		<fieldset class="quick">
			{L_SELECT_CATEGORY}: <select name="parent_id" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{CATEGORY_BOX}</select>

			<input class="button2" type="submit" value="{L_GO}" />
			{S_FORM_TOKEN}
		</fieldset>
		</form>

		<form id="categories" method="post" action="{U_ACTION}">

		<fieldset class="quick">
			<input type="hidden" name="action" value="add" />

			<input type="text" name="category_name" value="" maxlength="255" />
			<input class="button2" name="addcategory" type="submit" value="{L_CREATE_CATEGORY}" />
			{S_FORM_TOKEN}
		</fieldset>
		</form>

<!-- ENDIF -->
	<span class="corners-bottom"><span></span></span></div>
</div>

<!-- INCLUDE ucp_footer.html -->